/**
 * @param {number[]} hours
 * @return {number}
 */
var countCompleteDayPairs = function (hours) {
  const mod = 24
  const cnt = new Map()
  let ans = 0
  let tmp, ad
  for (let i = 0; i < hours.length; i++) {
    tmp = hours[i] % mod
    ans += cnt.get((mod - tmp) % mod) || 0
    cnt.set(tmp, (cnt.get(tmp) || 0) + 1)
  }
  return ans
};